# Contributor: Simon Thorpe <simon@hivetechnology.com.au>
# Contributor: James Pearson <james.m.pearson+arch@gmail.com>

pkgname=python-easygui
_pyname=easygui
pkgver=0.98.2
pkgrel=2
pkgdesc="Python module for very simple, very easy GUI programming"
url="https://easygui.readthedocs.io"
license=('BSD')
arch=('any')
depends=('python' 'tk')
makedepends=('python-setuptools')
source=("$_pyname-$pkgver.tar.gz::https://github.com/robertlugg/$_pyname/archive/refs/tags/$pkgver.tar.gz")
sha256sums=('d9d51033a93e3d24633bb02137bc7b6cea42e9a2cf287821c4e51f0fccc6ffe2')

build() {
  cd $_pyname-$pkgver
  python setup.py build
}

package(){
  cd $_pyname-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -dm755 "$pkgdir/usr/share/licenses/$pkgname"
  sed -n '/LICENSE INFORMATION/,/"""/ p' setup.py > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
